<?php
/**
 * 通用请求响应类
 * 
 * @author Kevin
 * @since May 13, 2015 7:44:57 PM
 * @version 2.0
 * @copyright 
 *
 */
class LibComResponse {
    /**
     * 请求成功返回的数据
     *
     * @param array $data
     *            成功返回的数据
     * @return array
     * @since May 13, 2015 7:36:45 PM
     * @access
     *
     */
    public static function successResponse($data,$serviceName='') {
        $arr = array (
                'status' => true,
                'from'=>'front '.$serviceName,
                'data' => $data 
        );
       return $arr;
    }
    /**
     * 请求成功返回的数据
     *
     * @param int $errorCode
     *            错误码
     * @param string $errorMsg
     *            错误信息
     * @return array
     * @since May 13, 2015 7:43:03 PM
     * @access
     *
     */
    public static function errorResponse($errorCode, $errorMsg,$serviceName='') {
        $arr = array (
                'status' => false,
                'from'=>'front '.$serviceName,
                'errorCode' => $errorCode,
                'errorMsg' => $errorMsg 
        );
        return $arr;
    }
}